<?php
session_start();
$hostname="mysql-user.cse.msu.edu"; // Host name
$username="hewittry"; // Mysql username
$password="A39777266"; // Mysql password
$database="hewittry"; // Database name
$currPage = "manage";
include("inc_header.php"); 

?>
	<div id="content">
	<h2><a href="#">Delete People</h2></a>
	
	What do you have against these people?
	<br /><br />

<?
		

	if ( $_SESSION["usertype"] == "admin" )
	{

		// If you have selected from list box.
		if(isset($_REQUEST['Delete'])){

		// Get records from database (table "name_list").
		$result=mysql_query("DELETE FROM AllUsers WHERE LogonID= '".$_REQUEST['pickdude']."'");
		}


		$list=mysql_query("SELECT LogonID FROM AllUsers WHERE userType != 1");
		?>



		<form method="post" action="delete.php" enctype="multipart/form-data">
		<select name="pickdude">
	<?php
		while($row_list=mysql_fetch_assoc($list)){
		?>
		
		<option value="<? echo $row_list['LogonID']; ?>" <? if($row_list['LogonID']==$select){ echo "selected"; } ?>><? echo $row_list['LogonID']; ?></option>
		<?
		// End while loop.
		}
		?>
		</select> 
	
		<input type="submit" name="Delete" value="Delete" />
			
		<p>
	
		</form>
		<br /><br />

		<?php
		
	}
	else
	{ 
		echo "You're no admin.  Get lost!";
	}
?>
	</div>
<?
include("inc_footer.php");
	?>
